package com.company;


import java.util.Scanner;

        public class Main {
            public static void main(String[] args) {
                Scanner sc= new Scanner(System.in);

                String dogName = sc.next();
                String dogSex = sc.next();
                String dogColor = sc.next();

                String catName = sc.next();
                String catSex = sc.next();
                double catWeight = sc.nextDouble();

                Dog dog=new Dog(dogName,dogSex,dogColor);
                dog.talk();
                dog.eat();

                Cat cat=new Cat(catName,catSex,catWeight);
                cat.talk();
                cat.eat();
            }
        }

        abstract class Pet {
            String name;
            String sex;
            public abstract void talk();
            public abstract void eat();
        }

        class Dog extends Pet {
            String color;
            public Dog(String name,String sex,String color){
                this.name=name;
                this.sex=sex;
                this.color=color;
            }
            public void talk(){
                System.out.println("名称："+name+"，性别："+sex+"，颜色："+color+"，汪汪叫");
            }
            public void eat(){
                System.out.println(name+"吃骨头！");
            }
        }

        class Cat extends Pet {
            double weight;
            Cat(String name,String sex,double weight){
                this.name=name;
                this.sex=sex;
                this.weight=weight;
            }
            public void talk(){
                System.out.println("名称："+name+"，性别："+sex+"，体重："+weight+"kg，喵喵叫");
            }
            public void eat(){
                System.out.println(name+"吃鱼！");
            }
        }